package designpatterns.command;

import lombok.extern.slf4j.Slf4j;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/15/2022 8:42 AM
 */
@Slf4j
public class Stock {

    private final String name = "ABC";
    private final int quantity = 10;

    public void buy() {
        log.info("bought:{}", this);
    }

    public void sell() {
        log.info("sold:{}", this);
        toString();
    }

    @Override
    public String toString() {
        return "Stock{" +
                "name='" + name + '\'' +
                ", quantity=" + quantity +
                '}';
    }
}
